<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <link rel="stylesheet" type="text/css" href="css/tabelas.css" />
        <title>AlunoNota</title>
    </h:head>
    <h:body>
        <div align="center">
        <div>
            <h:form>
                <table>
                    <tr>
                        <td>
                            Nome:
                        </td>
                        <td>
                            <h:inputText value="#{notabean.al.nome}" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Sobrenome:
                        </td>
                        <td>
                            <h:inputText value="#{notabean.al.sobrenome}" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Nota:
                        </td>
                        <td>
                            <h:inputText value="#{notabean.al.nota}" />
                        </td>
                    </tr>
            </table>
            <div>
                <h:commandButton action="#{notabean.addAluno}" value="Adicionar" />
            </div>
            </h:form>
        </div>


        <h:form>
        <h:dataTable value="#{notabean.alunos}" var="aluno"
                     styleClass="tabela" headerClass="cabecalho-tabela"
                     rowClasses="linha-par,linha-impar"
                    >
            <h:column>
            <f:facet name="header">
                Nome
            </f:facet>
                #{aluno.nome}
            </h:column>
            <h:column>
            <f:facet name="header">
                Sobrenome
            </f:facet>
                #{aluno.sobrenome}
            </h:column>
            <h:column>
            <f:facet name="header">
                Nota
            </f:facet>
                #{aluno.nota}
            </h:column>
            <h:column>
                <h:commandLink action="#{notabean.editarNota(aluno)}">
                    <h:graphicImage value="./img/green-arrow-up1.jpg" height="40px" width="40px"/>
                </h:commandLink>
            </h:column>
            <h:column>
                <h:commandLink action="#{notabean.delAluno(aluno)}">
                    <h:graphicImage value="./img/remove_256.png" height="40px" width="40px"/>
                </h:commandLink>
            </h:column>
        </h:dataTable>
        </h:form>
    </div>
    </h:body>
</html>

